/* CSS变量系统 - 高吸引力版 */
:root {
  --primary-color: #0f172a;
  --secondary-color: #1e293b;
  --accent-color: #06b6d4;
  --highlight-color: #a855f7;
  --gradient-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #0891b2 50%, #0e7490 100%);
  --gradient-highlight: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f43f5e 100%);
  --gradient-dynamic: linear-gradient(45deg, #06b6d4, #a855f7, #ec4899, #06b6d4);
  --gradient-aurora: conic-gradient(from 180deg at 50% 50%, #06b6d4, #a855f7, #ec4899, #06b6d4);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

html,
body {
  height: 100%;
  background: var(--gradient-primary);
  position: relative;
  overflow-x: hidden;
}

/* 动态背景装饰 */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: var(--gradient-aurora);
  animation: rotate 25s linear infinite;
  opacity: 0.05;
  z-index: -1;
  pointer-events: none;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.wrap {
  min-height: 100%;
  display: flex;
  position: relative;
  z-index: 1;
}

/* 移动端基础优化 */
@media screen and (max-width: 768px) {
  * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  input,
  textarea,
  select {
    -webkit-user-select: text;
    user-select: text;
  }

  body {
    -webkit-overflow-scrolling: touch;
    overflow-x: hidden;
  }
}

@media screen and (max-width: 768px) {
  .wrap {
    flex-direction: column;
  }
}

/* 提示框 - 玻璃态设计 */
.alert {
  width: 400px;
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  z-index: 10000;
  border-radius: 16px;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.2),
    0 8px 16px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: slide-in-top 0.6s var(--ease-out-expo);
}

@keyframes slide-in-top {
  0% {
    transform: translateX(-50%) translateY(-100px);
    opacity: 0;
  }

  100% {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

@media screen and (max-width: 768px) {
  .alert {
    width: 90%;
    top: 30px;
  }
}

.show {
  display: block;
  animation: slide-in-top 0.6s var(--ease-out-expo);
}

/* 侧边栏 - 高吸引力设计 */
.aside {
  width: 280px;
  background: var(--gradient-primary);
  padding-top: 40px;
  box-shadow:
    4px 0 20px rgba(6, 182, 212, 0.15),
    inset -1px 0 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.aside::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: var(--gradient-accent);
  opacity: 0.6;
}

.aside::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg at 50% 50%,
      transparent 0deg,
      rgba(6, 182, 212, 0.02) 60deg,
      rgba(168, 85, 247, 0.02) 120deg,
      rgba(236, 72, 153, 0.02) 180deg,
      transparent 360deg);
  animation: rotate 40s linear infinite;
  pointer-events: none;
}

@media screen and (max-width: 768px) {
  .aside {
    width: 100%;
    padding-top: 20px;
    padding-bottom: 20px;
  }
}

.aside h2 {
  text-align: center;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  margin-bottom: 30px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: glow-pulse 3s ease-in-out infinite alternate;
  position: relative;
}

@keyframes glow-pulse {
  0% {
    filter: brightness(1);
  }

  100% {
    filter: brightness(1.3);
  }
}

/* 侧边栏导航 */
.nav {
  padding-left: 20px;
  padding-right: 20px;
}

.nav li {
  width: 100%;
  height: 70px;
  line-height: 70px;
  color: white;
  cursor: pointer;
  list-style: none;
  margin-bottom: 8px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s var(--ease-out-expo);
}

.nav li::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(6, 182, 212, 0.2) 50%,
      transparent 100%);
  transition: left 0.6s ease;
}

.nav li:hover::before {
  left: 100%;
}

@media screen and (max-width: 768px) {
  .nav {
    display: flex;
    padding: 0 20px;
    justify-content: center;
    flex-wrap: wrap;
  }

  .nav li {
    width: auto;
    height: 50px;
    line-height: 50px;
    margin: 5px;
  }
}

.nav li a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  display: block;
  padding: 0 20px;
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav li a.active {
  color: #ffffff !important;
  background: var(--gradient-accent);
  border-radius: 12px;
  box-shadow:
    0 8px 24px rgba(6, 182, 212, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: scale(1.02);
}

.nav li a:hover {
  color: #ffffff;
  background: rgba(6, 182, 212, 0.15);
  border-radius: 12px;
  transform: translateX(8px);
}

/* 内容区域 */
.main {
  height: 100%;
  flex: 1;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  position: relative;
}

@media screen and (max-width: 768px) {
  .main {
    width: 100%;
  }
}

/* 顶部导航 - 高吸引力设计 */
.top-nav {
  height: 80px;
  border-bottom: 1px solid rgba(6, 182, 212, 0.2);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding-right: 40px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  position: relative;
  overflow: hidden;
}

.top-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: var(--gradient-dynamic);
  animation: flow-gradient 3s ease-in-out infinite;
}

@keyframes flow-gradient {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

.nav-item span {
  cursor: pointer;
  padding: 12px 24px;
  border-radius: 12px;
  transition: all 0.4s var(--ease-out-back);
  font-weight: 600;
  color: #475569;
  position: relative;
  overflow: hidden;
}


.nav-item span:hover {
  background: var(--gradient-accent);
  color: #ffffff;
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 8px 24px rgba(6, 182, 212, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-item span:last-of-type {
  margin-left: 20px;
}

/* 卡片容器布局 */
.content {
  padding: 40px;
}

@media screen and (max-width: 768px) {
  .content {
    padding: 20px;
  }
}

/* 卡片 - 高吸引力设计 */
.card {
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.1),
    0 10px 20px rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.15);
  padding: 30px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  transition: all 0.5s var(--ease-out-back);
  margin-bottom: 25px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-accent);
  transform: scaleX(0);
  transition: transform 0.4s var(--ease-out-expo);
  border-radius: 20px 20px 0 0;
}

.card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg at 50% 50%,
      transparent 0deg,
      rgba(6, 182, 212, 0.02) 60deg,
      rgba(168, 85, 247, 0.02) 120deg,
      rgba(236, 72, 153, 0.02) 180deg,
      transparent 360deg);
  animation: rotate 50s linear infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover::after {
  opacity: 1;
}

.card:hover {
  box-shadow:
    0 32px 64px rgba(6, 182, 212, 0.2),
    0 16px 32px rgba(0, 0, 0, 0.15);
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(6, 182, 212, 0.3);
}

/* 表单样式优化 */
.form-label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  display: block;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control,
.form-select {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 16px;
  transition: all 0.4s var(--ease-out-expo);
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent-color);
  box-shadow:
    0 0 0 6px rgba(6, 182, 212, 0.1),
    0 8px 24px rgba(6, 182, 212, 0.15);
  outline: none;
  transform: translateY(-2px);
}

.form-control:hover,
.form-select:hover {
  border-color: #22d3ee;
  box-shadow:
    0 6px 16px rgba(6, 182, 212, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* 按钮样式 */
.btn-primary {
  background: var(--gradient-accent);
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  transition: all 0.4s var(--ease-out-back);
  box-shadow:
    0 8px 24px rgba(6, 182, 212, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.3) 50%,
      transparent 100%);
  transition: left 0.6s ease;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 12px 32px rgba(6, 182, 212, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-secondary {
  background: var(--gradient-primary);
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  transition: all 0.4s var(--ease-out-back);
  box-shadow:
    0 8px 24px rgba(15, 23, 42, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-secondary:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 文件上传区域 */
.upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  background: rgba(6, 182, 212, 0.02);
  transition: all 0.4s var(--ease-out-expo);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.upload-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.upload-area:hover {
  border-color: var(--accent-color);
  background: rgba(6, 182, 212, 0.05);
  transform: scale(1.02);
}

.upload-area:hover::before {
  opacity: 0.05;
}

.upload-area.dragover {
  border-color: var(--accent-color);
  background: rgba(6, 182, 212, 0.1);
  transform: scale(1.02);
}

/* 编辑器样式 */
.editor-container {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.editor-toolbar {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.editor-btn {
  padding: 8px 12px;
  border: none;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  color: #475569;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.editor-btn:hover {
  background: var(--gradient-accent);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(6, 182, 212, 0.2);
}

.editor-content {
  min-height: 300px;
  padding: 20px;
  font-size: 16px;
  line-height: 1.6;
  outline: none;
  transition: all 0.3s ease;
}

.editor-content:focus {
  background: rgba(6, 182, 212, 0.02);
}

/* 响应式优化 */
@media screen and (max-width: 768px) {
  .card {
    padding: 20px;
    margin-bottom: 20px;
  }

  .form-control,
  .form-select {
    padding: 12px 16px;
    font-size: 14px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 12px 24px;
    font-size: 14px;
  }

  .upload-area {
    padding: 30px;
  }

  .editor-toolbar {
    padding: 8px;
  }

  .editor-content {
    min-height: 200px;
    padding: 15px;
    font-size: 14px;
  }
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3a7bd5 0%, #2c5fb9 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  box-shadow: 0 8px 30px rgba(58, 123, 213, 0.15);
  transform: translateY(-4px);
  border-color: rgba(58, 123, 213, 0.2);
}

.card .title {
  height: 55px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid #f0f3f7;
  font-weight: 600;
  color: #2c3e50;
  font-size: 16px;
}

/* 表单 */
.body form>div {
  margin-top: 20px;
}

.body form input,
.body form select {
  width: auto;
  display: inline-block;
}

/* 按钮样式优化 */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  font-size: 14px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, #3a7bd5 0%, #2c5fb9 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(58, 123, 213, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(58, 123, 213, 0.4);
  background: linear-gradient(135deg, #2c5fb9 0%, #1e4a8c 100%);
}

.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
  background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 封面 */
.cover .place {
  width: 200px;
  height: 200px;
  text-align: center;
  font-size: 40px;
  line-height: 200px;
  border: 2px dashed #d1d5db;
  color: #9ca3af;
  cursor: pointer;
  display: inline-block;
  vertical-align: top;
  border-radius: 12px;
  background: linear-gradient(145deg, #f9fafb 0%, #f3f4f6 100%);
  transition: all 0.3s ease;
}

.cover .place:hover {
  border-color: #3a7bd5;
  color: #3a7bd5;
  background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(58, 123, 213, 0.1);
}

.cover img {
  width: 200px;
  height: 200px;
}

/* 平板端优化 */
@media screen and (max-width: 768px) {
  .wrap {
    flex-direction: column;
  }

  .aside {
    width: 100%;
    padding: 15px;
    order: 2;
  }

  .aside .title {
    font-size: 18px;
    margin-bottom: 15px;
  }

  .nav {
    flex-direction: row;
    padding: 10px 0;
    overflow-x: auto;
  }

  .nav-item {
    min-width: 120px;
    margin-right: 15px;
  }

  .nav-item span {
    padding: 8px 16px;
    font-size: 14px;
  }

  .main {
    width: 100%;
    order: 1;
  }

  .content {
    padding: 20px 15px;
  }

  .card {
    padding: 20px;
    margin-bottom: 20px;
  }

  .cover .place {
    width: 160px;
    height: 160px;
    line-height: 160px;
    font-size: 32px;
  }

  .cover img {
    width: 160px;
    height: 160px;
  }

  .btn {
    padding: 8px 16px;
    font-size: 14px;
  }
}

.cover .rounded {
  display: none;
}

.cover .show {
  display: inline-block;
}

.cover .hide {
  display: none;
}

/* 富文本编辑器 */
#editor—wrapper {
  border: 1px solid #ccc;
  z-index: 100;
  /* 按需定义 */
}

#toolbar-container {
  border-bottom: 1px solid #ccc;
}

#editor-container {
  height: 500px;
}

/* 手机端优化 */
@media screen and (max-width: 480px) {
  .aside {
    padding: 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 0 0 20px 20px;
  }

  .aside .title {
    font-size: 18px;
    text-align: center;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 20px;
  }

  .nav {
    justify-content: flex-start;
    padding: 12px 0;
    gap: 8px;
  }

  .nav-item {
    min-width: auto;
    margin-right: 0;
    flex-shrink: 0;
  }

  .nav-item span {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
  }

  .content {
    padding: 20px 15px;
  }

  .card {
    padding: 25px 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
  }

  .card .title {
    height: auto;
    min-height: 50px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 20px;
    color: #2d3748;
  }

  .body form>div {
    margin-top: 20px;
  }

  .body form label {
    font-size: 15px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    display: block;
  }

  .body form input,
  .body form select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    margin-top: 8px;
    transition: all 0.3s ease;
    background: #ffffff;
  }

  .body form input:focus,
  .body form select:focus {
    border-color: #3a7bd5;
    box-shadow: 0 0 0 3px rgba(58, 123, 213, 0.1);
    transform: translateY(-1px);
  }

  .cover {
    text-align: center;
    margin: 20px 0;
  }

  .cover .place {
    width: 140px;
    height: 140px;
    line-height: 140px;
    font-size: 28px;
    border-radius: 15px;
    border: 3px dashed #cbd5e0;
    background: #f7fafc;
    transition: all 0.3s ease;
    margin: 0 auto;
  }

  .cover .place:hover {
    border-color: #3a7bd5;
    background: #ebf8ff;
    transform: scale(1.02);
  }

  .cover img {
    width: 140px;
    height: 140px;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }

  .btn {
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    margin-top: 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(58, 123, 213, 0.3);
  }

  .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(58, 123, 213, 0.4);
  }

  .btn:active {
    transform: translateY(0);
  }

  .btn+.btn {
    margin-left: 0;
    margin-top: 15px;
  }

  #editor-container {
    height: 280px !important;
    border-radius: 12px;
    overflow: hidden;
  }

  #toolbar-container {
    border-radius: 12px 12px 0 0;
    background: #f8fafc;
    padding: 8px;
  }

  #editor-container {
    height: 250px;
    border-radius: 8px;
  }

  #toolbar-container {
    overflow-x: auto;
    white-space: nowrap;
    padding: 8px;
    border-radius: 8px 8px 0 0;
  }

  #editor—wrapper {
    border-radius: 8px;
  }
}